-- GENERATED SPELL FOR [Eldreth Sorcerer] --


function spell0_11470(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(16006,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11470', 3000, 1)
end

function spell1_11470(pUnit, Event) --@Polymorph,n/a--
pUnit:FullCastSpellOnTarget(13323,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11470', 9500, 1)
end

function spell2_11470(pUnit, Event) --@Starshards,n/a--
pUnit:FullCastSpellOnTarget(22823,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_11470', 6000, 1)
end

function Sorts_11470(pUnit, Event)
local choix_sorts_11470 = math.random(0, 2)
if choix_sorts_11470 == 0 then
pUnit:RegisterEvent('spell0_11470', 1, 1)
end
if choix_sorts_11470 == 1 then
pUnit:RegisterEvent('spell1_11470', 1, 1)
end
if choix_sorts_11470 == 2 then
pUnit:RegisterEvent('spell2_11470', 1, 1)
end
end

function mob11470_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_11470', math.random(1500, 3000), 1)
end

function mob11470_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11470_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob11470_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(11470, 1, 'mob11470_Action')
RegisterUnitEvent(11470, 2, 'mob11470_Leave')
RegisterUnitEvent(11470, 3, 'mob11470_Kill')
RegisterUnitEvent(11470, 4, 'mob11470_Die')
